package com.wanmait.shoppingsys.controller.manage;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wanmait.shoppingsys.dao.GoodsDAO;
import com.wanmait.shoppingsys.dao.ManageDAO;
import com.wanmait.shoppingsys.util.ManagePager;
import com.wanmait.shoppingsys.vo.Goods;

@WebServlet("/OrderlistController")
public class OrderlistController extends HttpServlet{
	 private GoodsDAO goodsDAO=GoodsDAO.getDAO();
	 protected void doPost(HttpServletRequest request, HttpServletResponse response)
				throws ServletException, IOException {
			doGet(request, response);
		}
	 @Override
		protected void doGet(HttpServletRequest request, HttpServletResponse response)
				throws ServletException, IOException {
		 request.setCharacterEncoding("UTF-8");
		 String action=request.getParameter("action");
		 if(action==null)
		 {
			 return;
		 }
		 switch(action) {
		 case "serach": //根据订单号查询订单
			 this.serach(request, response);
			 break;
			 
		 }
		 }
		 protected void serach(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
			 ManagePager managepager = ManagePager.init(request);
			 ManageDAO manageDAO = new ManageDAO();
			 manageDAO.findByNum(managepager);
			 request.getRequestDispatcher("/manage/orderlist.jsp").forward(request, response);
		 }
}
